#!/usr/bin/env python  # encoding: utf-8
'''
  @author: HJW
  @license: (C) Copyright 2013-2017, Node Supply Chain Manager Corporation Limited.
  @contact: hejunwang01@126.com
  @file: test.py
  @time: 2022/4/15 0015 上午 0:35
  @desc:
  '''


# 嵌套函数 ,内部函数应用了外部的变量 或者参数 ,返回的是内部的函数
def fun1():
    x =10
    def inner():         #内部函数是使用了外部函数的变量或者参数
        return x*x
    return inner           #外部函数返回内部函数

def inner(x):
    return x

import time

def fun_out(inner):             #  装饰器中 参数只能有一个 ,且是函数类型
    def inner_out():
        begin = time.time()
        inner()
        endtime = time.time()
        print(endtime-begin)

    return inner_out

@fun_out
def work():
    for i in range(10000):
        print(i)
        # time.sleep(1)


def maopao(ls):
    n = len(ls)
    for i  in range(n):
        for j in range(0,n-i-1):
            if ls[j]>ls[j+1]:
                ls[j],ls[j+1] = ls[j+1],ls[j]



if __name__ == '__main__':
    pass
    # b=fun1()
    # print(b())
    # work()
    arr = [3,5,6,4]
    maopao(arr)
    for i in range(len(arr)):
        print(arr[i])

    arr2 = [3, 5, 6, 4,2]
    arr2.sort(reverse=True)
    print(arr2)

